<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改订单提成人信息')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-raker-edit" th:object="${zsyhUserRaker}">
            <h4 class="form-header h4">订单提成人信息信息</h4>
            <input name="id" th:field="*{id}" type="hidden">
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">提成人姓名：</label>
                        <div class="col-sm-8">
                            <p name="rakerPerson" style="border-width: 0px;padding:6px 4px;"  class="form-control">[[*{rakerPerson}]]</p>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">提成人手机号：</label>
                        <div class="col-sm-8">
                            <p name="rakerPhone" style="border-width: 0px;padding:6px 4px;"  class="form-control">[[*{rakerPhone}]]</p>
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">状态：</label>
                        <div class="col-sm-8">
                            <p name="rakerStateName" style="border-width: 0px;padding:6px 4px;"  class="form-control">[[*{rakerStateName}]]</p>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">所属大区：</label>
                        <div class="col-sm-8">
                            <p name="agentName" style="border-width: 0px;padding:6px 4px;"  class="form-control">[[*{agentName}]]</p>
                        </div>
                    </div>
                </div>
            </div>

            <div class="row" id="rejectReason">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">驳回原因：</label>
                        <div class="col-sm-8">
                            <p style="border-width: 0px;" name="rakerRejectReason" class="form-control">[[*{rakerRejectReason}]]</p>
                        </div>
                    </div>
                </div>
            </div>
            <h4 class="form-header h4">订单管理人管辖区域信息</h4>
            <div class="row">
                <div class="col-sm-12">
                    <div class="col-sm-12 select-table table-striped" style="margin-top: 0px;">
                        <table id="bootstrap-table"></table>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "zsyh/raker";
        $("#form-raker-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-raker-edit').serialize());
            }
        }

        $(function() {
            var options = {
                data: [[${zsyhUserRaker.zsyhUserRakeareaList}]],
                pagination: false,
                showSearch: false,
                showRefresh: false,
                showToggle: false,
                showColumns: false,
                sidePagination: "client",
                columns: [
                {
                    field: 'index',
                    align: 'center',
                    title: "序号",
                    formatter: function (value, row, index) {
                    	var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
                    	return columnIndex + $.table.serialNumber(index);
                    }
                },
                {
                    field: 'rakerProvinceName',
                    align: 'center',
                    title: '省级名称',
                    formatter: function(value, row, index) {
                        var html = $.common.sprintf("<input class='form-control' style='border-width: 0px;text-align: center' type='text' name='zsyhUserRakeareaList[%s].rakerProvinceName' value='%s' readonly>", index, value);
                        return html;
                    }
				},
                {
                    field: 'rakerCityName',
                    align: 'center',
                    title: '城市名称',
                    formatter: function(value, row, index) {
                        var html = $.common.sprintf("<input class='form-control' style='border-width: 0px;text-align: center' type='text' name='zsyhUserRakeareaList[%s].rakerCityName' value='%s' readonly>", index, value);
                        return html;
                    }
				},
                {
                    field: 'rakerDistrictName',
                    align: 'center',
                    title: '县区名称',
                    formatter: function(value, row, index) {
                        var html = $.common.sprintf("<input class='form-control' style='border-width: 0px;text-align: center' type='text' name='zsyhUserRakeareaList[%s].rakerDistrictName' value='%s' readonly>", index, value);
                        return html;
                    }
				},
                ]
            };
            $.table.init(options);
        });


        $(document).ready(function () {
            if([[${zsyhUserRaker.rakerStateName}]] == '驳回'){
                $("#rejectReason").css("display","block");

            }else{
                $("#rejectReason").css("display","none");
            }
        })

    </script>
</body>
</html>